import { Space } from 'ant-design-vue'
import { levMainColor } from '@/views/index/emergencyIndex/data.ts'
import { ThunderboltOutlined } from '@ant-design/icons-vue'
import { ref, reactive, computed, onMounted, watch, useAttrs, h } from 'vue'
import { nullC } from '../../../../util/common'

export const formatWarnLevel = (text: string, levelText: string = '预警') => {
  const color: any = {
    '1': levMainColor[0], '2': levMainColor[1], '3': levMainColor[2], '4': levMainColor[3]
  }
  const text1: any = {
    '1': '一', '2': '二', '3': '三', '4': '四'
  }
  return h(Space, () => [
    h(ThunderboltOutlined, { style: {color: nullC(color[text], color['4'])} }),
    h('span',  nullC(text1[text], text1['4']) + '级' + levelText)
  ])
}